package com.teach.servlet;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.teach.entity.user;
import com.teach.service.UserService;
import com.teach.service.impl.UserServiceImpl;

public class UserSelectByStringServlet extends HttpServlet{
	private UserService userService = new UserServiceImpl();
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
		try {
			String ss=req.getParameter("selectbystring");
			
			List<user> list = userService.SelectByString(ss);
			req.setAttribute("list", list);
		} catch (Exception e) {
			// TODO: handle exception
		}
		
		req.getRequestDispatcher("/admin/user-list.jsp").forward(req, resp);
	}
}
